import request from '@/utils/api'; 

// 获取用户所有通知（分页）
export const getNotificationsByUserId = (userId, page = 1, pageSize = 20) => {
  return request.get(`/api/notifications/user/${userId}`, {
    params: { page, pageSize }
  });
};

// 获取用户未读通知
export const getUnreadNotifications = (userId) => {
  return request.get(`/api/notifications/user/${userId}/unread`);
};

// 标记单个通知为已读
export const markNotificationAsRead = (id) => {
  return request.patch(`/api/notifications/${id}/read`);
};

// 标记所有通知为已读
export const markAllNotificationsAsRead = (userId) => {
  return request.patch(`/api/notifications/user/${userId}/read-all`);
};